package com.xhlj.utils;
/*用户类型*/

public enum UserType {
    /*
     * 1代表线上，2代表线下，3代表学生，4代表嘉宾
     *
     * */
    ONLINE(1),
    OFFLINE(2),
    STUDENT(3),
    EXPERT(5),
    GUEST(4);


    private final int value;

    UserType(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }
    /*将int转化为对应的enum*/
    public static UserType fromValue(int value) {
        for (UserType userType : UserType.values()) {
            if (userType.getValue() == value) {
                return userType;
            }
        }
        throw new IllegalArgumentException("Invalid value for UserType: " + value);
    }
}
